import { LAYOUT, newLAOUT, FORMITEM, newFORMITEM, FIELD, newFIELD } from '../attr-widget'

export interface CHECKBOX extends LAYOUT, FORMITEM, FIELD {
  options: { value: string, label: string }[]
}

export function newCHECKBOX(attr?: CHECKBOX): CHECKBOX {
  return Object.assign(
    newLAOUT(),
    newFORMITEM(),
    newFIELD(), 
    {
      options: [{ value: '1', label: '选项一' }, { value: '2', label: '选项二' }]
    },
    attr
  ) as CHECKBOX
}

export const STATUS_OPTIONS = [
  {value:'0',label:'隐藏'},
  {value:'1',label:'占位'},
  {value:'2',label:'只读'},
  {value:'3',label:'编辑'},
  {value:'4',label:'必填'}
]